package com.woniu.user.Es.EsRepo;

import com.woniu.user.Es.EsModel.EsCoachInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

public interface EsCoachRepo extends ElasticsearchRepository<EsCoachInfo, Integer> {
    @Query("{\n" +
            "      \"multi_match\":{\n" +
            "          \"query\": \"?0\",\n" +
            "          \"fields\": [\"username\",\"realname\",\"nickname\",\"gender\",\"style\",\"venueName\",\"introduce\"]\n" +
            "      }\n" +
            "  }")
    Page<EsCoachInfo> search(String keyword, PageRequest pageRequest);

    @Query("")
    EsCoachInfo findOne(Integer coachId);

}
